package com.example.mylibrary;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.EditText;

@SuppressLint("AppCompatCustomView")
public class MyEditText extends EditText {

    @SuppressLint("NewApi")
    public MyEditText(Context context) {
        super(context);
        applyCustomFont(context);
    }

    @SuppressLint("NewApi")
    public MyEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        applyCustomFont(context);
    }

    @SuppressLint("NewApi")
    public MyEditText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        applyCustomFont(context);
    }

    private void applyCustomFont(Context context) {
        Typeface myFont = Typeface.createFromAsset(context.getAssets(), "UKIJTor.ttf");
        setTypeface(myFont);
    }
}
